| species | n | proportion |
|---|---|---|
| Adelie | 152 | 44.2 |
| Gentoo | 124 | 36.0 |
| Chinstrap | 68 | 19.8 |
Quarto for scientific writing: Reports, presentations, and even blogs & websites
Available at lcgodoy.me/slides/2024-lm/
2024-11-04
Equations
Figures
Cross-references
Formatting
The most popular writing programs are Microsoft Word (first released in 1983 as Multi-Tool Word) and the much newer Google Docs (2006) 1.
They are often referred to “What You See Is What You Get” (WYSIWYG) text processors.
Common tasks in scientific writing can take more time than they should when working with WYSIWYG.
A markup language uses special codes to structure and format text.
One of the first markup languages is TeX (released in 1978). LaTeX is the most popular TeX-based language.
A popular (and newer) markup language is Markdown. Some Markdown extensions incorporate LaTeX features.
Sweave (Leisch 2002)
Org-mode (Schulte et al. 2012)
RMarkdown (Xie et al. 2018)
Quarto
Warning
Not an exhaustive list.
Content driven writing
Consistency and automation
Portability and longevity
Version control
Quarto is a literate programming that superseded R Markdown.
It is a standalone (sort of) piece of software instead of a package.
Support for several languages: R, python, julia, javascript.
It aims at making reproducible research and publications the norm rather than the exception.
Alternative: A code/text editor and a terminal
The Get Started page provides instructions on how to Download/Install Quarto and examples with different IDEs.
Everyone that wants to produce beautiful documents and is not afraid of some code would benefit from using Quarto.
Scientists that write documents with many equations.
Reproducible documents.
Learn one tool that can be used for writing reports, books, presentations, and even websites.
The density of a normally distributed random variable \(X\) with mean \(\mu\) and variance \(\sigma^2\) is \[ f(x) = \frac{1}{\sqrt{2 \pi \sigma^2}} \exp \left \{ \frac{1}{2 \sigma^2} (x - \mu)^2 \right \} \]
For more details about figures, see this link
::: {#fig-both layout-ncol=2}


My Caption!
:::For more details about figures, see this link
#| label: fig-peng
#| fig-cap: "A scatterplot."
library(ggplot2)
library(palmerpenguins)
library(dplyr)
data(package = "palmerpenguins")
ggplot(data = penguins,
aes(x = flipper_length_mm,
y = bill_length_mm,
color = species)) +
geom_point() +
theme_bw() +
labs(x = "Flipper length (mm)",
y = "Bill length (mm)",
color = "Species") +
theme(legend.position = "top")Figure 2: A scatterplot.
There are many options/configurations for tables available.
One can simply generate tables from code.
In Quarto we can cross-reference Sections, Equations, Figures, and Tables – we will refer to these categories as “entities”.
To enable this feature, each entity must have a label (unique identifier) and, for figures and tables, a caption. See Table 2.
| Entity | Label |
|---|---|
| Section | sec- |
| Table | tbl- |
| Figure | fig- |
| Equation | eq- |
Quarto does not have a Zotero plugin (you can find tutorials on how to use them together)
Before Zotero, there was BIBTeX!
BIBTeX is both a bibliographic database file format and a software for processing references (citations).
References are listed in a .bib file (show how to obtain bib entries).
I used the same code to generate a presentation, a pdf file, and an html report.
I will show the source for these files and their respective outputs.
I also used this example to showcase how Quarto’s cross-referencing works.
Quarto can enhance your productivity and the reproducibility of your research material
As any code-related resource, the learning curve may be steep
Once you learn, you can easily recycle and modify documents according to changes in your data
It is also trivial to change templates.
Although Quarto is open-source, its main developer (and maintainer) is a company (posit)
Quarto website provides many resources.
The gallery has examples categorized by their type (i.e., presentations, reports, etc)
A curated list of resources and features is available at awesome-quarto on GitHub.
I have a blog post on how to create your personal website using Quarto. The post also shows how to host it on GitHub Pages.